package com.ivo.activiti.bpmn.record;

import lombok.Getter;

/**
 * 签核操作类型
 * @author wj
 * @version 1.0
 */
@Getter
public enum Transition {

    Submit(0, "Submit", "同意"),
    Reject(1, "Reject", "不同意"),
    HandIn(2, "Hand In", "上呈"),
    HandOver(3, "Hand Over", "交办"),
    Recosign(4, "Recosign", "征询意见"),
    Hold(5, "Hold", "保留"),
    Void(6, "Void", "删除"),
    Save(7, "Save", "保存"),
    Recall(9, "Recall", "撤回"),
    Modify(12, "Modify", "修改"),
    ;

    private final int type;

    private final String description;

    private final String description2;

    Transition(int type, String description, String description2) {
        this.type = type;
        this.description = description;
        this.description2 = description2;
    }


    public static Transition getByType(int type) {
        for (Transition transition : values()) {
            if (transition.getType() == type) {
                return transition;
            }
        }
        return null;
    }
}
